import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Card } from 'antd';

@connect(({ integratedqueryns, loading }) => ({
  loading: loading.models.integratedqueryns,
  SuppBusiData: integratedqueryns.SuppBusiData, // 业务范围
  suppId: integratedqueryns.suppId, // 业务范围id
  SuppObj: integratedqueryns.SuppObj,
}))
@Form.create()
class EmpInfor extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  jumpRouting = (targetRouter, suppId, name) => {
    const { jumpRouting } = this.props;
    jumpRouting(targetRouter, suppId, name);
  };

  render() {
    const { SuppBusiData, suppId, SuppObj } = this.props;
    return (
      <div>
        <Card
          style={{ marginBottom: 12 }}
          title={<span style={{ fontWeight: 'bolder' }}>业务范围</span>}
          bordered={false}
          id="scopeofbusiness"
        >
          地区：{SuppBusiData && SuppBusiData.length ? SuppBusiData : '暂无数据'}
          {SuppBusiData && SuppBusiData.length ? (
            <a
              style={{ position: 'absolute', right: 20 }}
              onClick={() => this.jumpRouting('suppId', suppId, SuppObj.name)}
            >
              查看详情
            </a>
          ) : null}
        </Card>
      </div>
    );
  }
}
export default EmpInfor;
